<h1>Listing nagios_service_groups</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Hostgroups</th>
    <th>Services</th>
  </tr>

<% for nagios_service_group in @nagios_service_groups.sort{|a,b| a.name <=> b.name} %>
  <tr class=<%= cycle('row_odd','row_even')%> >
    <td>
      <%= link_to '[X]', nagios_service_group, :confirm => 'Are you sure?', :method => :delete %>
      <%= link_to nagios_service_group.name, edit_nagios_service_group_path(nagios_service_group) %>
    </td>
    <td>
      <% for detail in nagios_service_group.nagios_service_group_details %>
        <%= detail.nagios_host_group.name %><br/>
      <% end %>
    </td>
    <td>
      <% for detail in nagios_service_group.nagios_service_group_details %>
        <%= detail.nagios_service.name %><br/>
      <% end %>
    </td>
    
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New nagios_service_group', new_nagios_service_group_path %>
